import promptAction from '@ohos.promptAction'

const SHORT_TIME = 2 * 1000
const LONG_TIME = 4 * 1000

export class ToastUtil {
    showShortToast(msg) {
        promptAction.showToast({ message: msg, duration: SHORT_TIME })
    }

    showLongToast(msg) {
        promptAction.showToast({ message: msg, duration: LONG_TIME })
    }

    showCustomToast(msg, duration) {
        promptAction.showToast({ message: msg, duration: duration })
    }
}

let toastUtil = new ToastUtil();

export default toastUtil as ToastUtil
